/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package application;

import application.beans.MessageBean;
import java.sql.Date;

/**
 *
 * @author Étienne
 */
class Message {
    Integer idMessage;
    String message;
    Date date;
    Compte compte;

    public Compte getCompte() {
        return compte;
    }

    public void setCompte(Compte compte) {
        this.compte = compte;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getIdMessage() {
        return idMessage;
    }

    public void setIdMessage(Integer idMessage) {
        this.idMessage = idMessage;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    
    public Message ()
    {
    }
    
    public Message (Integer idMessage, Compte compte, Date date, String message)
    {
        this.idMessage = idMessage;
        this.compte = compte;
        this.date = date;
        this.message = message;
    }
    
    public MessageBean asBean(){
        MessageBean bean = new MessageBean(this.idMessage, this.message, this.date,
                this.compte.getBean());
        
        return bean;
    }
}
